<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>

<script type="text/javascript">
    //初始化倒计时间


    $(function () {
        timeout()
    })

    var m = 22;
    var s = 20;
    var die;

    function timeout() {
        s--;
        if (m == 00 && s != 00) {
            s--;
            if (s == 0) {
                window.location.reload();
            }
        } else {
            if (s == 00) {
                s = 10;
                m--;
                if (m == 00) {
                    window.location.reload();

                } else {
                    die = setTimeout(timeout, 100);
                    $("#ymd").html(m);
                }

            } else {

                die = setTimeout(timeout, 100);
                $("#yms").html(s);

            }

        }
        -1
    }

   

</script>

<body>
    <div id="ymd">10</div>
    <div id="yms">10</div>
    <p class="die">哈哈哈</p>
</body>

</html>
<script>
     $(".die").bind("click", function () {
         alert(1111);
    clearTimeout(die)
    })
</script>